﻿using JDKD.BMCS.Instruction;
using NutShell.DesignPattern;

namespace JDKD.BMCS.Business
{
        public class RaiseOperation : Operation
        {
                public RaiseOperation(int id, bool modify)
                        : base("Raise", id, modify)
                {
                }

                public override void Run()
                {
                        BusinessCache cache = Singleton<BusinessCache>.Instance;
                        Channel channel = cache.Channels[Id];

                        if (channel.RaiseType == RaiseType.自动)
                        {
                                SerialPortCommunication.SendRaiseInstruction(Id, Modify);
                                channel.IsRaised = Modify;
                        }
                        

                        
                        
                }
        }
}